package com.dykj.fireFighting.web.rocketmq.producer;

import com.dykj.fireFighting.web.model.report.DevHisSs;

import com.dykj.fireFighting.web.rocketmq.message.InsertDevHisSsMessage;
import com.dykj.fireFighting.web.rocketmq.message.InsertDevHisZcMessage;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: zly
 * @Description : 盛善
 * @Date: 2021-11-30
 */
@Component
public class InsertDevHisSsProducer {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;
    public void asyncSend(DevHisSs devHisSs, SendCallback callback) {
        InsertDevHisSsMessage insertDevHisSsMessage = new InsertDevHisSsMessage();
        insertDevHisSsMessage.setDevHisSs(devHisSs);
        // 异步发送消息
        rocketMQTemplate.asyncSend(InsertDevHisSsMessage.TOPIC, insertDevHisSsMessage, callback);


    }
}
